package com.eastfair.questionnaire.dto;

import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * <p>
 * 实体类
 * 问题
 * </p>
 *
 * @author yuwx
 * @since 2021-08-18
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "QuestionDTO", description = "问题")
public class QuestionDTO extends Entity<Long> implements Serializable {

    private static final long serialVersionUID = 1L;
    public interface validateBase {}
    public interface validateGet{}
    public interface validateSave {}
    public interface listWithSelectedAnswer {}
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
//    @NotNull(groups = {validateBase.class, validateSave.class,
//            listWithSelectedAnswer.class})
    private Long projectId;
    /**
     * 问卷名
     */
    @ApiModelProperty(value = "问卷名")
    @NotNull(groups = {validateSave.class,
            listWithSelectedAnswer.class})
    private Long questionnaireId;
    /**
     * 下一题
     */
    @ApiModelProperty(value = "下一题")
    private Long nextQuestionId;
    /**
     * 题型
     */
    @ApiModelProperty(value = "题型")
    @Size(max = 20, message = "题型长度不能超过20")
    @NotNull(groups = {validateSave.class})
    private String questionType;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sequence;
    /**
     * 问题名称
     */
    @ApiModelProperty(value = "问题名称")
    @Size(max = 128, message = "问题名称长度不能超过128")
    @NotNull(groups = {validateSave.class})
    private String name;
    /**
     * 问题英文名称
     */
    @ApiModelProperty(value = "问题英文名称")
    @Size(max = 128, message = "问题英文名称长度不能超过128")
    private String enName;
    /**
     * 问题别名
     */
    @ApiModelProperty(value = "问题别名")
    @Size(max = 128, message = "问题别名长度不能超过128")
    private String aliasName;
    /**
     * 问题英文别名
     */
    @ApiModelProperty(value = "问题英文别名")
    @Size(max = 128, message = "问题英文别名长度不能超过128")
    private String enAliasName;
    /**
     * 问题描述
     */
    @ApiModelProperty(value = "问题描述")
    @Size(max = 128, message = "问题描述长度不能超过128")
    private String description;
    /**
     * 必填
     */
    @ApiModelProperty(value = "必填")
    private Integer isRequired;


    /**
     * 选择答案数量下限
     */
    @ApiModelProperty(value = "选择答案数量下限")
    private Integer selectLower;
    /**
     * 选择答案数量上限
     */
    @ApiModelProperty(value = "选择答案数量上限")
    private Integer selectUpper;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;
    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;

}
